
export const getLeafData = (data: any) => {
  setIsLeaf(data)
  
  function setIsLeaf(data: any){
    data.forEach((item: any) => {
      let children = item.children
      if(!children){
        item.isLeaf = true
        return
      }
      if(children.length > 0){
        setIsLeaf(children)
      }
    })
  }

  return data
}